import com.alibaba.fastjson.JSON;
import vo.CroPurgoodsVos;
import vo.PurgoodsDescriptionVo;

/**
 * Created by wsx on 2017/5/14.
 */
public class jsontest {
    public static void main(String[] args){
        String json="{\"test\":\"0\",\"del_flag\":\"0\",\"createtime\":1494318353472,\"overdate\":1495787151000,\"goodsNumber\":\"50\",\"uniprice\":1000.0,\"detail\":\"乐视\",\"type\":\"0\"}";
        PurgoodsDescriptionVo purgoodsDescriptionVo= JSON.parseObject(json,PurgoodsDescriptionVo.class);
        System.out.println(purgoodsDescriptionVo.getDel_flag());
        String json2="{\"Title\":\"林氏木业韩式田园布沙发小户型客厅三人布艺沙发1+3组合家具950\",\"Price\":5760.00,\"OriginalPrice\":0,\"PostFee\":0,\"ItemImgs\":null,\"Skus\":[{\"PropertiesName\":[{\"PropId\":\"1627207\",\"PropName\":\"颜色分类\",\"PropValueId\":\"3232483\",\"PropValueName\":\"A款【单人+三人】米黄色\"},{\"PropId\":\"31480\",\"PropName\":\"几人坐\",\"PropValueId\":\"20213\",\"PropValueName\":\"透气棉麻+实木沙发脚/三款可选\"}],\"SkuId\":3356946872207,\"Iid\":null,\"NumId\":0,\"Properties\":\"1627207:3232483;31480:20213\",\"Quantity\":1442,\"Price\":2880.00,\"OriginalPrice\":0,\"USDPrice\":443.08,\"OuterId\":null,\"CreatedTime\":\"\\/Date(1494558346000)\\/\",\"ModifiedTime\":\"\\/Date(1494558346000)\\/\"},{\"PropertiesName\":[{\"PropId\":\"1627207\",\"PropName\":\"颜色分类\",\"PropValueId\":\"3232484\",\"PropValueName\":\"B款【单人+三人】芥末绿\"},{\"PropId\":\"31480\",\"PropName\":\"几人坐\",\"PropValueId\":\"20213\",\"PropValueName\":\"透气棉麻+实木沙发脚/三款可选\"}],\"SkuId\":3356946872208,\"Iid\":null,\"NumId\":0,\"Properties\":\"1627207:3232484;31480:20213\",\"Quantity\":1261,\"Price\":2880.00,\"OriginalPrice\":0,\"USDPrice\":443.08,\"OuterId\":null,\"CreatedTime\":\"\\/Date(1494558346000)\\/\",\"ModifiedTime\":\"\\/Date(1494558346000)\\/\"},{\"PropertiesName\":[{\"PropId\":\"1627207\",\"PropName\":\"颜色分类\",\"PropValueId\":\"3232481\",\"PropValueName\":\"C款【单人+三人】藏蓝色\"},{\"PropId\":\"31480\",\"PropName\":\"几人坐\",\"PropValueId\":\"20213\",\"PropValueName\":\"透气棉麻+实木沙发脚/三款可选\"}],\"SkuId\":3356946872206,\"Iid\":null,\"NumId\":0,\"Properties\":\"1627207:3232481;31480:20213\",\"Quantity\":1443,\"Price\":2880.00,\"OriginalPrice\":0,\"USDPrice\":443.08,\"OuterId\":null,\"CreatedTime\":\"\\/Date(1494558346000)\\/\",\"ModifiedTime\":\"\\/Date(1494558346000)\\/\"}],\"GoodsShowSkuItems\":[{\"PropName\":\"颜色分类\",\"PropertyAliasList\":[{\"PropId\":\"1627207\",\"PropValueId\":\"3232483\",\"CustomName\":\"A款【单人+三人】米黄色\",\"SmallImage\":\"https://img.alicdn.com/bao/uploaded/i2/143584903/TB2bj1sbmB0XKJjSZFsXXaxfpXa_!!143584903.jpg_30x30.jpg\",\"BigImage\":\"https://img.alicdn.com/bao/uploaded/i2/143584903/TB2bj1sbmB0XKJjSZFsXXaxfpXa_!!143584903.jpg\",\"IsImage\":true},{\"PropId\":\"1627207\",\"PropValueId\":\"3232484\",\"CustomName\":\"B款【单人+三人】芥末绿\",\"SmallImage\":\"https://img.alicdn.com/bao/uploaded/i2/143584903/TB2p3L3o9hlpuFjSspkXXa1ApXa_!!143584903.jpg_30x30.jpg\",\"BigImage\":\"https://img.alicdn.com/bao/uploaded/i2/143584903/TB2p3L3o9hlpuFjSspkXXa1ApXa_!!143584903.jpg\",\"IsImage\":true},{\"PropId\":\"1627207\",\"PropValueId\":\"3232481\",\"CustomName\":\"C款【单人+三人】藏蓝色\",\"SmallImage\":\"https://img.alicdn.com/bao/uploaded/i4/143584903/TB29WjPo9XlpuFjy0FeXXcJbFXa_!!143584903.jpg_30x30.jpg\",\"BigImage\":\"https://img.alicdn.com/bao/uploaded/i4/143584903/TB29WjPo9XlpuFjy0FeXXcJbFXa_!!143584903.jpg\",\"IsImage\":true}],\"IsHasImage\":true},{\"PropName\":\"几人坐\",\"PropertyAliasList\":[{\"PropId\":\"31480\",\"PropValueId\":\"20213\",\"CustomName\":\"透气棉麻+实木沙发脚/三款可选\",\"SmallImage\":null,\"BigImage\":null,\"IsImage\":false}],\"IsHasImage\":false}],\"PicUrl\":\"https://img.alicdn.com/bao/uploaded/i2/TB1DFqoRXXXXXXwXpXXXXXXXXXX_!!0-item_pic.jpg\",\"ShopUrl\":\"http://shop57301625.taobao.com\",\"Shop\":\"林氏木业家具旗舰店\",\"Source\":\"天猫商城\",\"NumIid\":0,\"DHLInvoiceDescription\":\"\",\"Url\":\"https://detail.tmall.com/item.htm?id=19865033373\",\"WebsiteType\":1,\"IsDiscount\":false,\"taobaoProductId\":0,\"descUrl\":\"http://dsc.taobaocdn.com/i3/191/650/19865033373/TB1hHp8RXXXXXaAaXXX8qtpFXlX.desc%7Cvar%5Edesc%3Bsign%5Ea4684874474feaa95142ad57a309662b%3Blang%5Egbk%3Bt%5E1494659162\"}";
//        CroPurgoods croPurgoods=JSON.parseObject(json2,CroPurgoods.class);
//        System.out.println("商品名称:"+croPurgoods.getTitle()+" 商品类型："+croPurgoods.getSkus().getPropertiesName().get(0).getPropName()+"商品的价格："+croPurgoods.getSkus().getPrice()+"商品的数量"+croPurgoods.getSkus().getQuantity()+"大图片"+croPurgoods.getGoodsShowSkuItems().getPropertyAliasList().get(0).getSmallImage()+"小图片:"+croPurgoods.getGoodsShowSkuItems().getPropertyAliasList().get(0).getBigImage());
           CroPurgoodsVos croPurgoodsVos =JSON.parseObject(json2, CroPurgoodsVos.class);
        System.out.println("商品名称:"+croPurgoodsVos.getTitle()+"商品种类:"+croPurgoodsVos.getSkus().get(0).getPropertiesName().get(0).getPropName()+croPurgoodsVos.getSkus().get(0).getPropertiesName().get(1).getPropName()+"图片："+croPurgoodsVos.getGoodsShowSkuItems().get(0).getPropertyAliasList().get(0).getSmallImage());
    }
}
